package com.bw.liveplay.common.network

import com.bw.liveplay.common.entity.*
import io.reactivex.Observable
import io.reactivex.Observer
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * @author KK
 * @description:
 * @date :2021/11/10 10:07
 *
 */
interface Api {
    companion object{
        const val BASEURL : String = "http://123.56.232.18:8080/serverdemo/"
    }

    //段子列表
    @GET("feeds/queryHotFeedsList")
    fun requestHomeList(@Query("feedId")feeId : Int,
                        @Query("feedType")feedType:String,
                        @Query("pageCount")pageCount:Int,
                        @Query("userId")userId:Int):
            Observable<HomeFeedEntity>

    //喜欢一条段子
    @GET("ugc/toggleFeedLike")
    fun requestLove(@Query("itemId")itemId:Long,
                    @Query("userId")userId:Int): Observable<LoveEntity>

    //踩一条段子
    @GET("ugc/dissFeed")
    fun requestDiss(@Query("itemId")itemId:Long,
                    @Query("userId")userId:Int): Observable<DissEntity>


    //推荐
    @GET("tag/queryTagList")
    fun requestTagList(@Query("offset")offset:Int,
                       @Query("pageCount")pageCount:Int,
                       @Query("tagId")tagId:Int,
                       @Query("tagType")tageType:String,
                       @Query("userId")userId:Int): Observable<RecommentEntity>


    //评论列表
    @GET("comment/queryFeedComments")
    fun requestCommentList(@Query("id")id : Int,
                        @Query("itemId")itemId:Long,
                        @Query("pageCount")pageCount:Int,
                        @Query("userId")userId:Int):
            Observable<CommentEntity>

    //添加评论
    @POST("comment/addComment")
    fun requestAddComment(@Query("commentText")commentText : String,
                           @Query("height")height:Int,
                           @Query("image_url")image_url:String,
                           @Query("itemId")itemId:Long,
                           @Query("userId")userId:Int,
                           @Query("video_url")video_url:String,
                           @Query("width")width:Int):
            Observable<AddCommentEntity>

    //关注
    @GET("tag/queryTagList")
    fun requestFocus(@Query("offset")offset:Int,
                       @Query("pageCount")pageCount:Int,
                       @Query("tagId")tagId:Int,
                       @Query("tagType")tageType:String,
                       @Query("userId")userId:Int): Observable<FocusEntity>

}